package com.flower.Feign;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/*
 *@ClassName FlowerFeginFallbackFactory
 *@Description sentinel整合fegin方式2
 *@Author 吃麻椒的花酱
 *@Date 2021/8/27 23:00
 *@Version 1.0
 */
@Component
public class FlowerFeginFallbackFactory implements FallbackFactory<FlowerFeign> {
    @Override
    public FlowerFeign create(Throwable throwable) {
        return new FlowerFeign(){
            @Override
            public Object getFlowers() {
                return throwable.getMessage();
            }
        };
    }
}
